using Blog.Service.Permission;
using Blog.Service.Permission.Output;
using Microsoft.AspNetCore.Mvc;

namespace Blog.API.Controllers;



/// <summary>
/// 权限
///</summary>
[ApiController]
[Route("api/admin/[controller]/[action]")]
public class PermissionController  : CrudController<PermissionModel>
{
    IPermissionService _permissionService;
    public PermissionController(IPermissionService permissionService) : base(permissionService)
    {
        _permissionService = permissionService;
    }

    /// <summary>
    /// 查询权限列表
    /// </summary>
    /// <param name="key"></param>
    /// <param name="start"></param>
    /// <param name="end"></param>
    /// <returns></returns>
    [HttpGet]
    public async Task<List<PermissionListOutput>> GetList(string? key, DateTime? start, DateTime? end)
    {
        return await _permissionService.GetList(key, start, end);
    }

    /// <summary>
    /// 查询角色权限-权限列表
    /// </summary>
    /// <returns></returns>
    [HttpGet]
    public async Task<object> GetPermissionList()
    {
        return await _permissionService.GetPermissionList();
    }
}